-
Notifications
You must be signed in to change notification settings - Fork 2.7k
wincred: Avoid memory corruption #5856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
wincred: Avoid memory corruption #5856
Conversation
`wcsncpy_s()` wants to write the terminating null character so we need to allocate one more space for it in the target memory block. This should fix crashes when trying to read passwords. When this happened, the password/token wouldn't print out and Git would therefore ask for a new password every time. Signed-off-by: David Macek <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks obviously correct to me, the documentation clearly states that the NUL
character must be accounted for. Thank you!
@hickford FYI this seems to have been introduced here, maybe you want to verify that there are no similar problems in near-by patches.
/add relnote bug A potential memory corruption in the optional The workflow run was started |
A potential memory corruption in the optional `wincred` credential helper [was fixed](git-for-windows/git#5856). Signed-off-by: gitforwindowshelper[bot] <[email protected]>
No description provided.